package battle
{
	import core.actor.core.ActorView;
	
	import flash.display.Loader;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.net.URLRequest;
	
	import magics.BattleCombiner;
	import magics.Magic;

	public class BattleScene extends Sprite
	{
		private var _bgContainer:Sprite;
		private var magic:Magic;
		public var combiner:BattleCombiner;
		public function BattleScene()
		{
			_bgContainer = new Sprite();
			_bgContainer.graphics.beginFill(0x333333);
			_bgContainer.graphics.drawRect(0,0,200,200);
			_bgContainer.x = 250;
			this.addChild(_bgContainer);
		}
		
		public function init():void
		{
/*			magic = new Magic();
			magic.init(this);
			magic.initAni("c:/ani_motion.xml");
			magic.setProperty("x",400);
			magic.setProperty("y",400);*/
			//LoadPicts();
			combiner = new BattleCombiner();
			combiner.setScene(this);
			combiner.initAni("../testRes/ani/fight_motion.xml");
			combiner.setBloodType("normal");
			combiner.setBloodNum(123456);
			
			var packsName:Array = ["m401t000","m402t000"//,"m405t000"
				,"m406t000","m407t000","m408t000","m409t000","m410t000"];
			
			var attacker:ActorView = new ActorView();
			//var BoneUrlStr:String = "../testRes/TestBoneRes.swf";
			attacker.initBone(packsName);
			attacker.x = 50;
			attacker.y = 250;
			/////////////////////////////this.addChild(attacker);
			combiner.setAttacker(attacker);
			
			var target:ActorView = new ActorView();
			//var BoneUrlStr:String = "../testRes/TestBoneRes.swf";
			target.initBone(packsName);
			target.x = 500;
			target.y = 250;
			//////////////////////////////this.addChild(target);
			var targets:Vector.<ActorView> = Vector.<ActorView>([target]);
			combiner.setTarget(targets);
			
		}
		
		public function testPlay():void
		{
			//magic.play();
			//combiner.testBlood();
			combiner.play();
			//mc.playAll();
			//combiner.testShake();
			//combiner.testFocus(500);
			//combiner.testZoom(2);
		}
		
		
	}
}